<?php include('header.php');?>
<?php 
$id = $_GET['id'];

?>
<body>
<form id="form1" name="form1" action="room_edit_save.php?id=<?php echo $id; ?>" method="post">
<div class="box">
  <div class="left"></div>
  <div class="right"></div>
    <div class="heading"><h1>แก้ไขการจองห้องพัก</h1>
    <div class="buttons"><a onclick="chk_form('form1');" class="button"><span>ยืนยันการแก้ไข</span></a><a onclick="Javascript:window.location='room_edit_detail.php?id=<?php echo $id;?>';" class="button"><span>ยกเลิก</span></a></div>
</div>
  <div class="content">
<fieldset class="ui-corner">
<legend>ข้อมูลห้องพัก</legend>
<?php 
$rQuery = mysql_query("SELECT reservation_checkin FROM reservation_session WHERE reservation_detail_id='$id' GROUP BY reservation_checkin");
$a=0;
while($rRow = mysql_fetch_array($rQuery)){
	$a++;
	$sQuery = mysql_query("SELECT room.room_name as room_name,room.room_pax as room_pax FROM reservation_session,room WHERE reservation_session.reservation_detail_id='$id' AND room.room_id = reservation_session.room_id AND reservation_session.reservation_checkin = '".$rRow['reservation_checkin']."'");
	
	echo "<div style=\"padding-bottom:5px;\"><b>วันที่ &nbsp;&nbsp;&nbsp;</b>".thai_date(strtotime($rRow['reservation_checkin']))."<b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ห้อง &nbsp;&nbsp;&nbsp;</b>";
	while($sRow = mysql_fetch_array($sQuery)){
		$room_name .= ", <b>".$sRow['room_name']."</b> (พัก ".$sRow['room_pax']." ท่าน)";
		$Room_Pax = $Room_Pax + $sRow['room_pax'];
	}
	echo substr($room_name, 2);
	echo "</div>";
	$room_name = "";

}
?>
<!-- 
<br>
<b>อาหารเช้า</b> <br>&nbsp;&nbsp;  <label><input type="radio" name="abf" id="abf1" value="yes" />รวมอาหารเช้า </label>&nbsp;&nbsp;&nbsp; <label><input type="radio" name="abf" id="abf2" value="no" />ไม่รวมอาหารเช้า </label>
 -->
<div style="padding-left: 10px; padding-top:20px;">
<table>
<?php
//กรณีเลือกรวมอาหารเช้า
if($_POST['Abf']!=""){
/*
	$AbfQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '1'");
	$AbfRow = mysql_fetch_array($AbfQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','1','".$_POST['Abf']."','".$AbfRow['more_information_price']."')");
*/
?>
	<tr>
		<td><input type="checkbox" name="Abf" id="Abf" checked="checked" onclick="return false;" value="0" /> รวมอาหารเช้า </td>
		<td><b>จำนวน </b><span style="padding-left: 5px"><?php echo $_POST['tAbf'];?></span><input name="tAbf" type="hidden" value="<?php echo $_POST['tAbf'];?>" ></td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือกExtra Bed + ABF
if($_POST['tExtraAbf']!=""){
/*
	$tExtraAbfQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '2'");
	$tExtraAbfRow = mysql_fetch_array($tExtraAbfQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','2','".$_POST['tExtraAbf']."','".$tExtraAbfRow['more_information_price']."')");
*/
?>
	<tr>
		<td><input type="checkbox" name="ExtraAbf" id="ExtraAbf" checked="checked" value="1" onclick="return false;" /> Extra Bed + ABF</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tExtraAbf'];?></span><input name="tExtraAbf" type="hidden" value="<?php echo $_POST['tExtraAbf'];?>" ></td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือก Extra Bed
if($_POST['tExtra']!=""){ 	
/*
	$tExtraQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '3'");
	$tExtraRow = mysql_fetch_array($tExtraQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','3','".$_POST['tExtra']."','".$tExtraRow['more_information_price']."')");
*/
?>
	<tr>
		<td><input type="checkbox" name="Extra" id="Extra" checked="checked" value="2" onclick="return false;" /> Extra Bed</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tExtra'];?></span><input name="tExtra" type="hidden" value="<?php echo $_POST['tExtra'];?>" id="tExtra" size="1"> </td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือก ABF (ผู้ใหญ่)
if($_POST['tAbfA']!=""){ 	
/*	$tAbfAQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '4'");
	$tAbfARow = mysql_fetch_array($tAbfAQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','4','".$_POST['tAbfA']."','".$tAbfARow['more_information_price']."')");
*/
?>
	<tr>
		<td><input type="checkbox" name="AbfA" id="AbfA" checked="checked" value="3" onclick="return false;" /> ABF (ผู้ใหญ่)</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tAbfA'];?></span><input name="tAbfA" type="hidden" value="<?php echo $_POST['tAbfA'];?>" id="tAbfA" size="1"> </td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือก ABF (เด็ก)
if($_POST['tAbfC']!=""){ 	
/*	$tAbfCQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '5'");
	$tAbfCRow = mysql_fetch_array($tAbfCQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','5','".$_POST['tAbfC']."','".$tAbfCRow['more_information_price']."')");
*/
?>	
	<tr>
		<td><input type="checkbox" name="AbfC" id="AbfC" checked="checked" value="4" onclick="return false;" /> ABF (เด็ก)</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tAbfC'];?></span><input name="tAbfC" type="hidden" value="<?php echo $_POST['tAbfC'];?>" id="tAbfC" size="1"> </td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือก พักเพิ่ม (ผู้ใหญ่)
if($_POST['tAddA']!=""){ 	
/*	$tAddAQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '6'");
	$tAddARow = mysql_fetch_array($tAddAQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','6','".$_POST['tAddA']."','".$tAddARow['more_information_price']."')");
*/
?>	
	<tr>
		<td><input type="checkbox" name="AddA" id="AddA" checked="checked" value="5" onclick="return false;" /> พักเพิ่ม (ผู้ใหญ่)</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tAddA'];?></span><input name="tAddA" type="hidden" value="<?php echo $_POST['tAddA'];?>" id="tAddA" size="1"> </td>
	</tr>
<?php } ?>
<?php 
//กรณีเลือก พักเพิ่ม (เด็ก)
if($_POST['tAddC']!=""){ 	
/*	$tAddCQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '7'");
	$tAddCRow = mysql_fetch_array($tAddCQuery);
	mysql_query("INSERT INTO reservation_information (reservation_detail_id,more_information_id,more_information_value,more_information_price) VALUE ('".$reservation_detail_id."','7','".$_POST['tAddC']."','".$tAddCRow['more_information_price']."')");
*/
?>	
	<tr>
		<td><input type="checkbox" name="AddC" id="AddC" checked="checked" value="6" onclick="return false;" /> พักเพิ่ม (เด็ก)</td>
		<td><b>จำนวน </b><span style="padding-left: 5px;"><?php echo $_POST['tAddC'];?></span><input name="tAddC" type="hidden" value="<?php echo $_POST['tAddC'];?>" id="tAddC" size="1"> </td>
	</tr>
<?php } ?>
</table>
</div>
</fieldset>

<fieldset class="ui-corner">
<legend>ข้อมูลผู้จอง</legend>
    <table class="form">
       <tr>
        <td>ชื่อ : </td>
        <td><?php echo $_POST['fname'];?><input name="fname" type="hidden" id="fname" value="<?php echo $_POST['fname'];?>" /></td>
      </tr>
       <tr>
        <td>นามสกุล : </td>
        <td><?php echo $_POST['lname'];?><input name="lname" type="hidden" id="lname" value="<?php echo $_POST['lname'];?>" /></td>
      </tr>      
       <tr>
        <td>ชื่อบริษัท : </td>
        <td><?php echo $_POST['name'];?><input name="name" type="hidden" id="name" value="<?php echo $_POST['name'];?>" /></td>
      </tr>   
       <tr>
        <td>เบอร์โทรศัพท์ : </td>
        <td><?php echo $_POST['phone'];?><input name="phone" type="hidden" id="phone" value="<?php echo $_POST['phone'];?>" /></td>
      </tr>   
       <tr>
        <td>เบอร์แฟ็กซ์ : </td>
        <td><?php echo $_POST['fax'];?><input name="fax" type="hidden" id="fax" value="<?php echo $_POST['fax'];?>" /></td>
      </tr>   
       <tr>
        <td>อีเมล์ : </td>
        <td><?php echo $_POST['email'];?><input name="email" type="hidden" id="email" value="<?php echo $_POST['email'];?>" /></td>
      </tr>                                
    </table>
</fieldset>

<fieldset class="ui-corner">
<legend>ข้อมูลการชำระเงิน</legend>
<div style="width:600px;">

<input name="tResep" type="hidden" value="<?php echo $_POST['tResep'];?>" />
<input name="Group_Detail" type="hidden" value="<?php echo $_POST['Group_Detail'];?>" />
<?php 
$tABF = $_POST['tAbf'];
$ExtraAbf = $_POST['tExtraAbf'];
$Extra = $_POST['tExtra'];
$AbfA = $_POST['tAbfA'];
$AbfC = $_POST['tAbfC'];
$AddA = $_POST['tAddA'];
$AddC = $_POST['tAddC'];
$gValue = $_POST['Group_Detail'];

//กรณีเลือกบริษัททัวร์
if($_POST['tResep']=='special'){

	$rQuery = mysql_query("SELECT roomtype.roomtype_id as roomtype,roomtype.roomtype_name as roomtype_name,count(roomtype.roomtype_id) as roomtype_id,group_detail_room.group_detail_room_price as group_detail_room_price FROM reservation_session,roomtype,room,group_detail,group_detail_room WHERE reservation_session.reservation_detail_id='$id' AND group_detail_room.group_detail_id = group_detail.group_detail_id AND group_detail_room.roomtype_id = roomtype.roomtype_id AND room.roomtype_id=group_detail_room.roomtype_id AND room.room_id=reservation_session.room_id AND group_detail.group_detail_id = '".$gValue."' GROUP BY roomtype.roomtype_id ORDER BY roomtype.roomtype_name");

	$sQuery = mysql_query("SELECT group_detail_name FROM group_detail WHERE group_detail_id = '".$gValue."'");
	$sRow = mysql_fetch_array($sQuery);
?>
<input name="tReseps" type="hidden" value="special" />
<h3>บริษัท <?php echo $sRow['group_detail_name'];?></h3>
<table class="list">
<thead>
  <tr>
    <td class="center">ลำดับ</td>
    <td class="center">รายการ</td>
    <td class="center">จำนวน</td>
    <td class="center">ราคา/หน่วย</td>
    <td class="center">รวม</td>
  </tr>
</thead>
<?php 
$num=0;
while($rRow = mysql_fetch_array($rQuery)){
	$num++;
?>
  <tr>
    <td class="center"><?php echo $num;?></td>
    <td class="pLeft">
    <?php echo $rRow['roomtype_name']." ";
    	$RmQuery = mysql_query("SELECT room.room_name as room_name FROM room,reservation_session,roomtype WHERE reservation_session.reservation_detail_id='$id' AND room.roomtype_id=roomtype.roomtype_id AND room.room_id = reservation_session.room_id AND roomtype.roomtype_id = '".$rRow['roomtype']."' GROUP BY room.room_id");
    	while($RmRow = mysql_fetch_array($RmQuery)){
    		$room_name .= ", ".$RmRow['room_name'];
    	}
    		echo "(".substr($room_name, 2).")";
		$room_name = "";
    ?></td>
    <td class="pRight"><?php echo $rRow['roomtype_id'];?></td>
    <td class="pRight"><?php echo bath_format($rRow['group_detail_room_price']);?></td>
    <td class="pRight"><?php echo bath_format($rRow['roomtype_id']*$rRow['group_detail_room_price']);?></td>
  </tr>
<?php 
	$strtal = $strtal+($rRow['roomtype_id']*$rRow['group_detail_room_price']);
}
}

//กรณีเลือก W/N
if($_POST['tResep']=='walkin'){
	$rQuery = mysql_query("SELECT roomtype.roomtype_id as roomtype,roomtype_name,count(roomtype.roomtype_id) as roomtype_id,roomtype.roomtype_price as roomtype_price FROM reservation_session,roomtype,room WHERE reservation_session.reservation_detail_id='$id' AND room.roomtype_id=roomtype.roomtype_id AND room.room_id=reservation_session.room_id GROUP BY roomtype.roomtype_id ORDER BY roomtype.roomtype_name");
	$discount = $_POST['discount'];
	$discount2 = $_POST['discount2'];

?>
<!-- แสดงรายการ Walk-in -->
<input name="tReseps" type="hidden" value="walkin" />
<h3>W/N</h3>
<table class="list">
<thead>
  <tr>
    <td class="center">ลำดับ</td>
    <td class="center">รายการ</td>
    <td class="center">จำนวน</td>
    <td class="center">ราคา/หน่วย</td>
    <td class="center">รวม</td>
  </tr>
</thead>
<?php 
$num=0;
while($rRow = mysql_fetch_array($rQuery)){
	$num++;
?>
  <tr>
    <td class="center"><?php echo $num;?></td>
    <td class="pLeft">
    <?php echo $rRow['roomtype_name']." ";
    	$RmQuery = mysql_query("SELECT room.room_name as room_name FROM room,reservation_session,roomtype WHERE reservation_session.reservation_detail_id='$id' AND room.roomtype_id=roomtype.roomtype_id AND room.room_id = reservation_session.room_id AND roomtype.roomtype_id = '".$rRow['roomtype']."' GROUP BY room.room_id");
    	while($RmRow = mysql_fetch_array($RmQuery)){
    		$room_name .= ", ".$RmRow['room_name'];
    	}
    		echo "(".substr($room_name, 2).")";
		$room_name = "";
    ?></td>
    <td class="pRight"><?php echo $rRow['roomtype_id'];?></td>
    <td class="pRight"><?php echo bath_format($rRow['roomtype_price']);?></td>
    <td class="pRight"><?php echo bath_format($rRow['roomtype_id']*$rRow['roomtype_price']);?></td>
  </tr>
<?php 
	$strtal = $strtal+($rRow['roomtype_id']*$rRow['roomtype_price']);
}
}
?>
<?php 
//กรณีเลือกกรุ๊ป
if($_POST['tResep']=='group'){

	$gCount = count($_POST['list']);
	$cCount = 0;
?>
<input name="tReseps" type="hidden" value="group" />
<h3>กรุ๊ป</h3>
<table class="list">
<thead>
  <tr>
    <td class="center" width="1">ลำดับ</td>
    <td class="center">รายการ</td>
    <td class="center" width="13%">จำนวน</td>
    <td class="center" width="13%">ราคา/หน่วย</td>
    <td class="center" width="18%">รวม</td>
  </tr>
</thead>
<?php 
	for($i=0;$i<$gCount;$i++){
		if($_POST['list'][$i]!="" && $_POST['amount'][$i]!="" && $_POST['price'][$i]!=""){
			$cCount = $cCount+1;
?>
  <tr>
    <td class="center"><?php echo $cCount;?></td>
    <td class="pLeft"><?php echo $_POST['list'][$i];?><input name="list[<?php echo $i;?>]" type="hidden" value="<?php echo $_POST['list'][$i];?>" /></td>
    <td class="pRight"><?php echo $_POST['amount'][$i];?><input name="amount[<?php echo $i;?>]" type="hidden" value="<?php echo $_POST['amount'][$i];?>" /></td>
    <td class="pRight"><?php echo bath_format($_POST['price'][$i]);?><input name="price[<?php echo $i;?>]" type="hidden" value="<?php echo $_POST['price'][$i];?>" /></td>
    <td class="pRight"><?php echo bath_format($_POST['amount'][$i]*$_POST['price'][$i]);?></td>
  </tr>
<?php 
	$strtal = $strtal+($_POST['amount'][$i]*$_POST['price'][$i]);
		}
	}
?>
  <tr>
	<td colspan="4" class="center"><b>รวมเงิน</b></td>
	<td class="pRight"><b><?php echo bath_format($strtal);?></b><input name="rTotal" type="hidden" value="<?php echo $strtal;?>" /></td>
  </tr>
</table>
<?php
}
?>


<?php 
//กรณีเลือก Special หรือ Walkin
if($_POST['tResep']=='special' || $_POST['tResep']=='walkin'){
?>
<?php if($tABF!=""){
	$tABFQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '1'");
	$tABFRow = mysql_fetch_array($tABFQuery);
	$NumtABF = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumtABF;?></td>
    <td class="pLeft"><?php echo "รวมอาหารเช้า";?></td>
    <td class="pRight"><?php echo $tABF;?></td>
    <td class="pRight"><?php echo bath_format($tABFRow['more_information_price']);?></td>
    <td class="pRight"><?php $tABFTotal = $tABF*$tABFRow['more_information_price']; echo bath_format($tABFTotal);?></td>
  </tr>
<?php } ?>
<?php if($ExtraAbf!=""){
	$ExtraAbfQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '2'");
	$ExtraAbfRow = mysql_fetch_array($ExtraAbfQuery);
	$NumExtraAbf = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF;?></td>
    <td class="pLeft"><?php echo "Extra Bed + ABF";?></td>
    <td class="pRight"><?php echo $ExtraAbf;?></td>
    <td class="pRight"><?php echo bath_format($ExtraAbfRow['more_information_price']);?></td>
    <td class="pRight"><?php $ExtraAbfTotal = $ExtraAbf*$ExtraAbfRow['more_information_price']; echo bath_format($ExtraAbfTotal);?></td>
  </tr>
<?php } ?>
<?php if($Extra!=""){
	$ExtraQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '3'");
	$ExtraRow = mysql_fetch_array($ExtraQuery);
	$NumExtra = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF+$NumExtra;?></td>
    <td class="pLeft"><?php echo "Extra Bed";?></td>
    <td class="pRight"><?php echo $Extra;?></td>
    <td class="pRight"><?php echo bath_format($ExtraRow['more_information_price']);?></td>
    <td class="pRight"><?php $ExtraTotal = $Extra*$ExtraRow['more_information_price']; echo bath_format($ExtraTotal);?></td>
  </tr>
<?php } ?>
<?php if($AbfA!=""){
	$AbfAQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '4'");
	$AbfARow = mysql_fetch_array($AbfAQuery);
	$NumAbfA = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF+$NumExtra+$NumAbfA;?></td>
    <td class="pLeft"><?php echo "ABF (ผู้ใหญ่)";?></td>
    <td class="pRight"><?php echo $AbfA;?></td>
    <td class="pRight"><?php echo bath_format($AbfARow['more_information_price']);?></td>
    <td class="pRight"><?php $AbfATotal = $AbfA*$AbfARow['more_information_price']; echo bath_format($AbfATotal);?></td>
  </tr>
<?php } ?>
<?php if($AbfC!=""){
	$AbfCQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '5'");
	$AbfCRow = mysql_fetch_array($AbfCQuery);
	$NumAbfC = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF+$NumExtra+$NumAbfA+$NumAbfC;?></td>
    <td class="pLeft"><?php echo "ABF (เด็ก)";?></td>
    <td class="pRight"><?php echo $AbfC;?></td>
    <td class="pRight"><?php echo bath_format($AbfCRow['more_information_price']);?></td>
    <td class="pRight"><?php $AbfCTotal = $AbfC*$AbfCRow['more_information_price']; echo bath_format($AbfCTotal);?></td>
  </tr>
<?php } ?>
<?php if($AddA!=""){
	$AddAQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '6'");
	$AddARow = mysql_fetch_array($AddAQuery);
	$NumAddA = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF+$NumExtra+$NumAbfA+$NumAbfC+$NumAddA;?></td>
    <td class="pLeft"><?php echo "พักเพิ่ม (ผู้ใหญ่)";?></td>
    <td class="pRight"><?php echo $AddA;?></td>
    <td class="pRight"><?php echo bath_format($AddARow['more_information_price']);?></td>
    <td class="pRight"><?php $AddATotal = $AddA*$AddARow['more_information_price']; echo bath_format($AddATotal);?></td>
  </tr>
<?php } ?>
<?php if($AddC!=""){
	$AddCQuery = mysql_query("SELECT more_information_price FROM more_information WHERE more_information_id = '7'");
	$AddCRow = mysql_fetch_array($AddCQuery);
	$NumAddC = 1;
?>
  <tr>
    <td class="center"><?php echo $num+$NumExtraAbf+$NumtABF+$NumExtra+$NumAbfA+$NumAbfC+$NumAddC+$NumAddA;?></td>
    <td class="pLeft"><?php echo "พักเพิ่ม (เด็ก)";?></td>
    <td class="pRight"><?php echo $AddC;?></td>
    <td class="pRight"><?php echo bath_format($AddCRow['more_information_price']);?></td>
    <td class="pRight"><?php $AddCTotal = $AddC*$AddCRow['more_information_price']; echo bath_format($AddCTotal);?></td>
  </tr>
<?php } ?>
  <tr>
	<td colspan="4" class="center"><b>รวมเงิน</b></td>
	<td class="pRight"><b><?php $strtalAll = $strtal+$tABFTotal+$ExtraAbfTotal+$ExtraTotal+$AbfATotal+$AbfCTotal+$AddATotal+$AddCTotal; echo bath_format($strtalAll);?></b></td>
  </tr>
</table>
<?php } ?>
<?php 
//แสดงเงินรวมหลังลดแล้วกรณี W/N
if($_POST['tResep']=='walkin'){
	$mTotal = $strtalAll - $discount2;
?>
<div align="right">ส่วนลด % : <?php echo $discount;?><input name="discount" type="hidden" value="<?php echo $discount;?>" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ส่วนลดเป็นเงิน <?php echo bath_format($discount2);?><input name="discount2" type="hidden" value="<?php echo $discount2;?>" /></div>
<div align="right" style="padding-top: 15px; font-weight: bold;">รวมเป็นเงิน <?php echo bath_format($mTotal);?> บาท</div>
<input name="rTotal" type="hidden" value="<?php echo $mTotal;?>" />
<?php } else if($_POST['tResep']=='special'){ ?>
<input name="rTotal" type="hidden" value="<?php echo $strtalAll;?>" />
<?php } ?>
</div>
</fieldset>

<fieldset class="ui-corner">
<legend>ข้อมูลรายละเอียดเพิ่มเติม</legend>
<?php
if($_POST['remark']==""){
	echo "-";
?>
<input name="remark" type="hidden" value="<?php echo "-";?>" />
<?php
} else {
echo $_POST['remark'];?>
<input name="remark" type="hidden" value="<?php echo $_POST['remark'];?>" />
<textarea name="remark" rows="5" style="visibility: hidden; display:none;" cols="100"><?php echo $_POST['remark'];?></textarea>
<?php } ?>
</fieldset>


<fieldset class="ui-corner">
<legend>ข้อมูลผู้รับจอง</legend>
   <table class="form">
       <tr>
        <td>ชื่อ-นามสกุล : </td>
        <td><?php echo $_POST['name_r'];?><input name="name_r" type="hidden" id="name_r" value="<?php echo $_POST['name_r'];?>" /></td>
      </tr>
       <tr>
        <td>เบอร์โทรศัพท์ : </td>
        <td><?php echo $_POST['phone_r'];?><input name="phone_r" type="hidden" id="phone_r" value="<?php echo $_POST['phone_r'];?>" /></td>
      </tr>                              
    </table>
</fieldset>
  </div>
</div>
</form>
</body>
<?php include('footer.php');?>
